/*
 * Copyright 2009, 2010, YUNNAN Co-soft Information Technology Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cs.web;

import java.lang.reflect.Field;
import java.util.Collections;
import java.util.Set;

/**
 * This class defines all message model relevant keys.
 *
 * @author <a href="mailto:DL88250@gmail.com">Liang Ding</a>
 * @version 1.0.0.2, Jun 24, 2010
 */
public abstract class AbstractI18nModel {

    /**
     * The value of each field is the key of i18n in properties.
     */
    private Set<Field> fields;

    /**
     * Public default constructor. Initializes {@link #fields}.
     */
    public AbstractI18nModel() {
        final Field[] fieldsArray = getClass().getFields();
        fields = com.cs.web.util.Collections.arrayToSet(fieldsArray);
    }

    

    /**
     * Gets {@link #fields}.
     *
     * @return fields
     */
    public final Set<Field> getFields() {
        return Collections.unmodifiableSet(fields);
    }
}
